class WelcomeController < ApplicationController


  def index
  end

  def header
  end
  def order

  end
  def select_people
    @people = ['赵大','钱二','张三','李四','王五','赵六']
    p '====================='
    p @people

    # @people = User.all

  end
  def choose_restaurant
    @restaurant = ['KFC','7-11','成都小吃']
  end


  def fist_package

    data={
   'KFC'=>[{name:'田园脆鸡堡',price:'￥10.00'},{name:'老北京鸡肉卷',price:'￥14.00'},{name:'劲脆鸡腿堡',price:'￥15.00'}],
   '7-11'=>[{name:'半荤半素',price:'￥11.50'},{name:'全荤',price:'￥15.00'},{name:'全素',price:'￥10.00'}],
   '成都小吃'=>[{name:'鱼香肉丝',price:'￥10.00'},{name:'回锅肉',price:'￥14.00'},{name:'孜然羊肉',price:'￥15.00'}],

    }
     @package = data[params[:restaurant]]


  end
  def create

    p params
    @form_date = Form.new({people: params[:people],restaurant: params[:restaurant],package: params[:package],price: params[:price]})
    @form_date.save

    redirect_to @form_date

  end
  def check_order
    @pull_date = Form.all

  end


  def get_order

    @pull_date = Form.all

    render :json =>@pull_date
  end
  def not_order
    @people = ['赵大','钱二','张三','李四','王五','赵六']
    render :json =>@people


  end
  def resolve
  @pull_date = Form.all

    render :json =>@pull_date


  end
end



# def params_form
#   params_form={
#        :people=>params[:people],
#        :restaurant=>params[:restaurant],
#        :package=>params[:package]
#   }
#   p "====================="
#   p params_form
# end



